package com.joolun.cloud.mall.common.feign;

import com.joolun.cloud.common.core.constant.SecurityConstants;
import com.joolun.cloud.common.core.constant.ServiceNameConstants;
import com.joolun.cloud.common.core.util.R;
import com.joolun.cloud.weixin.common.entity.WxTemplateMsg;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import com.joolun.cloud.weixin.common.dto.WxTemplateMsgSendDTO;

/**
 * @author www.joolun.com
 */
@FeignClient(contextId = "feignWxTemplateMsgService", value = ServiceNameConstants.WX_ADMIN_SERVICE)
public interface FeignWxTemplateMsgService {

	/**
	 * 发送微信小程序订阅消息
	 * @param wxTemplateMsgSendDTO
	 * @param from
	 * @return
	 */
	@PostMapping("/wxtemplatemsg/inside/send/ma")
	R sendTemplateMsgMa(@RequestBody WxTemplateMsgSendDTO wxTemplateMsgSendDTO, @RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 发送微信公众号模板消息
	 * @param wxTemplateMsgSendDTO
	 * @param from
	 * @return
	 */
	@PostMapping("/wxtemplatemsg/inside/send/mp")
	R sendTemplateMsgMp(@RequestBody WxTemplateMsgSendDTO wxTemplateMsgSendDTO, @RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * list列表，可指定useType
	 * @param wxTemplateMsg
	 * @param from
	 * @return
	 */
	@PostMapping("/wxtemplatemsg/inside/list")
	R getTemplateList(@RequestBody WxTemplateMsg wxTemplateMsg, @RequestHeader(SecurityConstants.FROM) String from);
}
